Skip to content

Fix RM pro temperature sensor#50098

Merged
MartinHjelmare merged 5 commits intohome-assistant:devfrom
felipediel:fix-rmpro-sensor
May 7, 2021
Merged

Fix RM pro temperature sensor#50098
MartinHjelmare merged 5 commits intohome-assistant:devfrom
felipediel:fix-rmpro-sensor

Conversation

@felipediel
Copy link
Copy Markdown
Contributor

@felipediel felipediel commented May 5, 2021

The problem

RM pro has a firmware issue that causes it to return -7 ºC when we call check_sensors() around 22.9 and 23 ºC.

If we ignore the issue, we return unreliable data. If we add a conditional and raise an exception, we raise false positives (-7 ºC may be a valid temperature), and it would also flood the logs, this behavior is consistent.

The right place to fix this is the firmware, but we don't have access to it.

Proposed change

Add a conditional to the update manager and replace -7 with the previous temperature when the variation is bigger than 3 °C.

If we get -7 °C at startup, we return None, so the temperature will be unknown until we get a different value, from which it will be possible to determine whether the next -7 is valid or not.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link
Copy Markdown

Hey there @Danielhiversen, mind taking a look at this pull request as its been labeled with an integration (broadlink) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@janiversen
Copy link
Copy Markdown
Member

Thanks for adding the test. The new function "normalised" makes it real easy understand how you "overwrite" the faulty temperature.

@felipediel
Copy link
Copy Markdown
Contributor Author

Thank you!

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@MartinHjelmare MartinHjelmare merged commit a7ef3ec into home-assistant:dev May 7, 2021
@MartinHjelmare
Copy link
Copy Markdown
Member

Should we tag this for a patch release?

@frenck
Copy link
Copy Markdown
Member

frenck commented May 7, 2021

Looks very localized, lets add it to help some people out.

@frenck frenck added this to the 2021.5.1 milestone May 7, 2021
frenck pushed a commit that referenced this pull request May 7, 2021
@frenck frenck mentioned this pull request May 7, 2021
@felipediel
Copy link
Copy Markdown
Contributor Author

Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple Broadlink Temp Sensors occasionally report 249 degC after upgrade to 116.x from 114.4

6 participants